<tr class="materiales_row">
  <% fields_for 'presencia[material_attributes][]', material do |m| %>
    <td><%= m.collection_select(:material_id, @materiales, :alternate_id, :valor, {:include_blank => true}) %></td>
    <td><%= m.text_field(:cantidad, :size => 5) %></td>
    <td><%= m.text_field(:costo_unitario, :size => 5) %></td>
    <td><%= m.text_field(:descripcion) %></td>
    <td><%= link_to_function "Quitar", "$(this).up('.materiales_row').remove()" %></td>
  <% end %>
</tr>
